#include <iostream>
#include <ctime>
#include <fstream>
#include <vector>
using namespace std;

vector <int> stroka(vector <int> a){
  for(int i = 0; i < a.size(); i++){
    int k = 0;
    for(int j = 0; j < a.size() - 1 - i; j++){
      if(a[j] > a[j + 1]){
        int b = a[j];
        a[j] = a[j + 1];
        a[j + 1] = b;
    }
  }
  if(k == 0){
    break;
    }
  }
  return a;  
}
int main() {
  ifstream s;
  s.open("m1_sorted.txt");
  vector <int> a;
  int c;
  while(s >> c){
    a.push_back(c);
  }
  vector <int> stroka(vector <int> a);
  double start = clock();
  a = stroka(a);
  double end = clock();
  cout << "m1_sorted.txt" <<" "<< (end - start) / 1000 <<" "<< "millisecond" << endl;
  ifstream s1;
  s1.open("m1_sorted.txt");
  vector <int> a1;
  int c1;
  while(s1 >> c1){
    a1.push_back(c1);
  }
  vector <int> stroka(vector <int> a1);
  double start1 = clock();
  a1 = stroka(a1);
  double end1 = clock();
  cout << "m1_reverse.txt" <<" "<< (end1 - start1) / 1000 <<" "<< "millisecond" << endl;
  ifstream s2;
  s2.open("m1_shuffle.txt");
  vector <int> a2;
  int c2;
  while(s2 >> c2){
    a2.push_back(c2);
  }
  vector <int> stroka(vector <int> a2);
  double start2 = clock();
  a2 = stroka(a2);
  double end2 = clock();
  cout << "m1_shuffle.txt" <<" "<< (end2 - start2) / 1000 <<" "<< "millisecond" << endl;

}